<template>
  <div>
    <el-dropdown-menu>
      <el-dropdown-item
        :icon="item.icon"
        v-for="(item, index) in myConfig"
        :key="index"
        :command="item"
      >
        <template v-slot="scope" style="display: flexz">
          <slot :name="item.type" :row="item" :index="scope.row">
            {{ item.name }}
            <!-- {{scope.row[item.type]}} -->
          </slot>
        </template>
      </el-dropdown-item>
    </el-dropdown-menu>
  </div>
</template>

<script lang="ts" setup>
import { computed, defineProps } from "vue"
import { IUserSetting } from "@/views/main/cps/head/config/userSetting"

const props = defineProps({
  config: {
    type: Array,
    required: true
  }
})
const myConfig = computed(() => [...props.config] as IUserSetting[])
</script>
